package com.ruibei.utils;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

import android.graphics.Bitmap;
/**
 * 文件处理工具类
 * @author wu
 *
 */
public class FileUtil {
	/**
	 * 保存图片
	 * @return
	 */
	public static void saveImage(String image_path,Bitmap bmp) {
		 FileOutputStream b = null;  
		
         try {  
             b = new FileOutputStream(new File(image_path));  
             bmp.compress(Bitmap.CompressFormat.JPEG, 100, b);// 把数据写入文件  
         } 
         catch (FileNotFoundException e) {  
             e.printStackTrace();  
         } 
         finally {  
             
        	 try {  
                 b.flush();  
                 b.close();  
             } 
        	 catch (IOException e) 
        	 {  
                 e.printStackTrace();  
             } 
         }
	}
}
